home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / CONTRSRC.ZIP / SRC / KARMA / DISK.INC next >
Encoding:
Text File  |  1994-05-15  |  1.9 KB  |  56 lines

  1. ;***********************************************************
  2. ;.                                                         *     
  3. ;.   ce fichier include contient deux routines nécéssaires *
  4. ;.   aux accès fichier en lec/ec .                         *
  5. ;.                                                         *     
  6. ;*********************************************************** 
  7. lecture proc near
  8.         ;cx     doit contenir la taille
  9.         ;ds:dx  pointe sur le nom
  10.         ;ds:bp  l'adresse de destination
  11.         
  12.         mov     ax,3d42h
  13.         int     21h
  14.         jnc     noerror
  15.         mov     ax,-1
  16.         jmp     abortlec
  17. noerror:
  18.         mov     si,ax
  19.         mov     ax,3f00h
  20.         mov     bx,si
  21.         mov     dx,bp
  22.         int     21h
  23. abortlec:
  24.         ret
  25. lecture endp
  26. ;******************************************************************
  27. ecriture proc near
  28.         ;cx      doit contenir la taille 
  29.         ;ds:dx   pointe sur le nom du fichier
  30.         ;bp      doit contenir l'offset d'ecriture DANS le fichier(16bits...)
  31.         ;ds:si   l'adresse de la zone a ecrire
  32.         
  33.         mov     ax,3d42h                ; ouvre le fichier
  34.         int     21h
  35.         jc      abortec
  36.                               ; deplace le pointeur fichier
  37.         push    cx
  38.         mov     bx,ax         ; bx<---handle
  39.         mov     ah,42h
  40.         mov     al,0          ; al<---code de distance (0=from debut)
  41.         mov     cx,0          ; cx<---distance (mot fort)
  42.         mov     dx,bp         ; dx<---distance (mot faible)
  43.         int     21h
  44.         pop     cx
  45.         jc      abortec
  46.         
  47.         mov     dx,si                   ; début de la zone a ecrire
  48.         mov     ax,4000h
  49.         int     21h                     ; ecrit
  50.         
  51.         mov     ah,3eh                  ; ferme fichier
  52.         int     21h
  53. abortec:
  54.         ret
  55. ecriture endp
  56.